<template>

  <div class="main-div">

    <Row>
      <Col span="24">
        <Card style="margin-left: 20px;margin-bottom: 10px;margin-top: 15px">
          <p slot="title">BPM引擎信息</p>
          <el-form ref="queryForm" :model="queryForm" label-width="220px">


            <el-tabs v-model="activeName" >
              <el-tab-pane label="基本信息" name="first">
                <el-form-item label="引擎名称：">
                  <el-link type="primary">{{queryForm.name}}</el-link>
                </el-form-item>
                <el-form-item label="模型编码：">
                  <el-link type="primary">{{queryForm.xmlEncoding}}</el-link>
                </el-form-item>
                <el-form-item label="是否开启ElasticSearch：">
                  <el-switch
                    v-model="queryForm.enableElasticSearch"
                  >
                  </el-switch>
                </el-form-item>

                <el-form-item label="是否开启Mongodb：">
                  <el-switch
                    v-model="queryForm.enableMongodb">
                  </el-switch>
                </el-form-item>
                <el-form-item label="是否开启分布式缓存包：">
                  <el-switch
                    v-model="queryForm.enableRedis">
                  </el-switch>
                </el-form-item>
                <el-form-item label="是否开启流程定时器：">
                  <el-switch
                    v-model="queryForm.enableJob">
                  </el-switch>
                </el-form-item>
                <el-form-item label="是否开启隐藏任务功能：">
                  <el-switch
                    v-model="queryForm.enableTaskHidden">
                  </el-switch>
                </el-form-item>
                <el-form-item label="是否开启并发锁部署流程功能：">
                  <el-switch
                    v-model="queryForm.enableConcurrentDeployer">
                  </el-switch>
                </el-form-item>
                <el-form-item label="是否开启循环任务功能：">
                  <el-switch
                    v-model="queryForm.loopTask">
                  </el-switch>
                </el-form-item>
                <el-form-item label="是否开启发送邮件功能：">
                  <el-switch
                    v-model="queryForm.enableMail">
                  </el-switch>
                </el-form-item>
                <el-form-item label="是否开启发送手机短信功能：">
                  <el-switch
                    v-model="queryForm.enableMobileMsg">
                  </el-switch>
                </el-form-item>
                <el-form-item label="引擎信息">
                  <el-link type="primary">{{queryForm.multiple==true?"多引擎":'单引擎'}}</el-link>
                </el-form-item>
              </el-tab-pane>
              <el-tab-pane label="异步执行器" name="job">
                <el-form-item label="重试次数：">
                  <el-link type="primary">{{queryForm.asyncExecutorNumberOfRetries}}</el-link>
                </el-form-item>
                <el-form-item label="池子数量：">
                  <el-link type="primary">{{queryForm.asyncExecutorCorePoolSize}}</el-link>
                </el-form-item>
                <el-form-item label="最大池子数量：">
                  <el-link type="primary">{{queryForm.asyncExecutorMaxPoolSize}}</el-link>
                </el-form-item>
                <el-form-item label="线程KeepAlive：">
                  <el-link type="primary">{{queryForm.asyncExecutorThreadKeepAliveTime}}</el-link>
                </el-form-item>
                <el-form-item label="线程池子队列：">
                  <el-link type="primary">{{queryForm.asyncExecutorThreadPoolQueueSize}}</el-link>
                </el-form-item>
                <el-form-item label="线程等待时间：">
                  <el-link type="primary">{{queryForm.asyncExecutorSecondsToWaitOnShutdown}}</el-link>
                </el-form-item>
                <el-form-item label="批次可执行作业：">
                  <el-link type="primary">{{queryForm.asyncExecutorMaxTimerJobsPerAcquisition}}</el-link>
                </el-form-item>
                <el-form-item label="作业抓取数量时间（毫秒）：">
                  <el-link type="primary">{{queryForm.asyncExecutorTimerLockTimeInMillis}}</el-link>
                </el-form-item>


              </el-tab-pane>
              <el-tab-pane label="图片信息" name="second">
                <el-alert  type="success" title="不建议在盘古BPM平台中使用图片生成技术，如果必须使用，请记得配置中文字体且宿主机中存在该字体。防止中文乱码" style="padding-top: 20px"></el-alert>
                <el-form-item label="活动字体：">
                  <el-link type="primary">{{queryForm.activityFontName}}</el-link>
                </el-form-item>
                <el-form-item label="连线字体：">
                  <el-link type="primary">{{queryForm.labelFontName}}</el-link>
                </el-form-item>
                <el-form-item label="批注字体：">
                  <el-link type="primary">{{queryForm.annotationFontName}}</el-link>
                </el-form-item>
                <el-form-item label="折线连线是否绘制：">
                  <el-link type="primary">{{queryForm.drawSequenceFlowNameWithNoLabelDI==true?'是':'否'}}</el-link>
                </el-form-item>
                <el-form-item label="部署流程生成图片：">
                  <el-link type="primary">{{queryForm.isCreateDiagramOnDeploy==true?'是':'否'}}</el-link>
                </el-form-item>



              </el-tab-pane>
              <el-tab-pane label="MyBatis批处理" name="three">
                <el-alert  type="success" title="批处理数目与数据库有关系，具体可以参考相关手册" style="padding-top: 20px"></el-alert>
                <el-form-item label="批处理：">
                  <el-link type="primary">{{queryForm.bulkInsertEnabled==true?'是':'否'}}</el-link>
                </el-form-item>
                <el-form-item label="批次数目：">
                  <el-link type="primary">{{queryForm.maxNrOfStatementsInBulkInsert}}</el-link>
                </el-form-item>

              </el-tab-pane>
              <el-tab-pane label="历史数据" name="his">
                <el-form-item label="存储历史数据：">
                  <el-link type="primary">{{queryForm.dbHistoryUsed==true?'是':'否'}}</el-link>
                </el-form-item>
                <el-form-item label="历史数据级别：">
                  <el-link type="primary">{{queryForm.history}}</el-link>
                </el-form-item>
                <el-form-item label="流程定义历史级别：">
                  <el-link type="primary">{{queryForm.enableProcessDefinitionHistoryLevel==true?'是':'否'}}</el-link>
                </el-form-item>
                <el-form-item label="历史数据异步插入：">
                  <el-link type="primary">{{queryForm.asyncHistoryExecutorActivate==true?'是':'否'}}</el-link>
                </el-form-item>

              </el-tab-pane>
              <el-tab-pane label="租户" name="NO_TENANT_ID">
                <el-form-item label="空租户值：">
                  <el-link type="primary">{{queryForm.noTenantId}}</el-link>
                </el-form-item>

              </el-tab-pane>
              <el-tab-pane label="批处理" name="batch">
                <el-form-item label="任务批量审批：">
                  <el-link type="primary">{{queryForm.enableBatchTask==true?'是':'否'}}</el-link>

                </el-form-item>

              </el-tab-pane>
            </el-tabs>

          </el-form>
        </Card>

      </Col>


    </Row>
  </div>





</template>

<script>
  import {getMonitor, getBpmnModelCategory, delMonitorById, getBpmEngine} from "@/api/analy";

  export default {
    name: 'Task',
    components: {},

    data() {
      return {
        tableData: [],
        tableHeight: 450,
        queryDate: [],
        delMsgModal: false,
        delMsgModalId: "",
        total: 0,
        chartVisible: false,
        forbiddenSwitch: false,
        modal_loading: false,
        chartData: {},
        sellerId: 0,
        shopName: [],
        queryForm: {
          name: "盘古",
          enableElasticSearch: false,
          enableMongodb: false,
          enableRedis: false,
          enableJob: false,
          multiple: false,
          asyncExecutorNumberOfRetries: 3,
          asyncExecutorCorePoolSize: 3,
          asyncExecutorMaxPoolSize: 3,
          asyncExecutorThreadKeepAliveTime: 5000,
          asyncExecutorThreadPoolQueueSize: 100,
          asyncExecutorSecondsToWaitOnShutdown: 60,
          asyncExecutorMaxTimerJobsPerAcquisition: 1,
          asyncExecutorMaxAsyncJobsDuePerAcquisition: 1,
          asyncExecutorDefaultTimerJobAcquireWaitTime: 1000,
          asyncExecutorDefaultQueueSizeFullWaitTime: 1000,
          asyncExecutorTimerLockTimeInMillis: 1000,
          asyncExecutorResetExpiredJobsInterval: 1000,
          asyncExecutorResetExpiredJobsMaxTimeout: 1000,
          asyncExecutorResetExpiredJobsPageSize: 1000,

          activityFontName:"宋体",
          labelFontName:"宋体",
          annotationFontName:"宋体",
          drawSequenceFlowNameWithNoLabelDI:true,
          isCreateDiagramOnDeploy:false,

          page: 0,
          limit: 1000,
          whereSql: "",
          type: ""
        },
        activeName: 'first'
      }
    },
    mount() {
      this.getData()
      this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop
    },
    created() {
      this.getData()
    },
    methods: {

      getData: function () {
        getBpmEngine({}).then((response) => {
          this.queryForm = response.data;


        })
      },


    }

  }

</script>
<style lang="scss" scoped>
  .main-div {
    background-color: #f3f3f3!important;
  }

  .task-card {
    margin-top: 10px;
  }

</style>
